package com.beans;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;

/**
 * Created with IntelliJ IDEA.
 * Description: 测试 Bean 的生命周期类2
 */
@Controller
public class UserTestBean2 {
    @Autowired
    User user1;

    public User test() {
        User user = user1;
        System.out.println("user原name：" + user.getName());
        user.setName("王五");
        return user;
    }
}
